package club.caihappy.admin.mapper;

import club.caihappy.admin.bean.City;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

/**
 * Created by DELL on 2021/11/18
 **/
@Mapper
public interface CityMapper {
    @Select("select * from city where id=#{id}")
    public City getCityById(Long id);

    @Insert("insert into city (`name`, `state`, `country`) values (#{name}, #{state}, #{country})")
    @Options(useGeneratedKeys = true, keyProperty = "id")
    public void insert(City city);
}
